import http from "../../utils/request"
import qs from 'qs'
import {delEmp, editRoleByIdEmp, listEmp, saveOrUpdateEmp} from "./employee";

//获取管理员列表
export const listAdmin = (params) =>{
  return http.post('/admin/listAdmin',qs.stringify(params));
}
//添加修改管理员
export const saveOrUpdateAdmin = (data) =>{
  return http.post('/admin/saveOrUpdateAdmin',qs.stringify(data));
}
//获取一个管理员，包括他的角色
export const editRoleByIdAdmin = (data) =>{
  return http.post('/admin/editRoleByIdAdmin',qs.stringify(data));
}
//删除管理员
export const delAdmin = (data) =>{
  return http.post('/admin/delAdmin',qs.stringify(data));
}
//给管理员分配角色
export const addAdminRole = (data) =>{
  return http.post('/admin/addAdminRole',qs.stringify(data));
}

export default {
  listAdmin,
  saveOrUpdateAdmin,
  editRoleByIdAdmin,
  delAdmin,
  addAdminRole
}
